module.exports = {
  checkEmptyParams(req, methods = 'get', keys = []) {
    if (!keys?.length) {
      throw new Error('checkEmptyParams keys为空');
    }
    for (let i = 0; i < keys.length; i++) {
      const item = keys[i];
      if (req.body[item] === undefined || req.body[item] === null) {
        throw new Error(`${ item }不能为空`);
      }
    }
  },
};
